The Meridian Enterprise AutoCAD link assumes that each drawing contains one title block or multiple identical title blocks in the same layout. AutoCAD drawings that contain multiple title blocks with different attribute values in each layout require special configuration. In both cases, the attribute values of the blocks will be the same within the same layout.
The AutoCAD link accommodates this by supporting two user-defined VBScript functions, one to read the attribute values of specified title blocks and one to write the attribute values of specified title blocks.
The implementation of these functions is the responsibility of the customer. The functions can have any valid names. The link simply calls the functions at the appropriate moment during standard title block synchronization. The functions should contain all of the logic necessary to read and write the appropriate attribute values in the drawings, such as with Visual Basic for Applications.
Both of the functions will be called by the AutoCAD link with one parameter. The parameter is an array of arrays that each contain strings in the following order:
Recommended logic for both functions to iterate through the parameter array is shown in the following example.
Function UpdateFromDoc(PropList) On Error Resume Next If IsArray(PropList) Then iSize = UBound(PropList) For i = 0 To iSize CurProp = PropList(i) If IsArray(CurProp) Then If UBound(CurProp) = 3 Then 'Read the corresponding attribute value or write 'the corresponding vault property here. End If End If Next End If UpdateFromDoc = True End Function
The title block reading function may return any value, the value is not checked by the link.
If the return value of the title block writing function is True, the link will check all new values provided by the function and will set the corresponding attributes. To set an empty value, use an empty string (""). When the function is called, all parameter elements are Empty.
To configure synchronization for multiple blocks per drawing:
Following is an example of the preceding settings.
[Settings] UpdatePropertiesToDocument=UpdateToDoc UpdatePropertiesFromDocument=UpdateFromDoc [BLOCK_1] PROJECT_NM=Custom.Projectname FIELD1=UseScriptFunction FIELD2=UseScriptFunction,WO FIELD3=UseScriptFunction,RO
In this example, the script function UpdateToDoc will be called to update the attributes FIELD1 and FIELD2 for all instances of the block BLOCK_1. The script function UpdateFromDoc will be called to update the properties that correspond to attributes FIELD1 and FIELD3 for all instances of the block BLOCK_1.
Related concepts